API Documentation for: 1.1.23
Show:

BitmapUtils (CreateJS) Class

Namespace: cloudkid

[CreateJS only] Designed to provide utility related to Bitmaps.

Item Index

Methods

loadSpriteSheet

(
  • frameDict
  • spritesheetImage
  • [scale=1]
)
static

Defined in loadSpriteSheet:14

Replaces Bitmaps in the global lib dictionary with a version that pulls the image from a spritesheet.

Parameters:

  • frameDict Object

    A dictionary of frame information, with frame, trimmed, and spriteSourceSize properties (like the JSON hash output from TexturePacker).

  • spritesheetImage Image | HTMLCanvasElement

    The spritesheet image that contains all of the frames.

  • [scale=1] Number optional

    The scale to apply to all sprites from the spritesheet. For example, a half sized spritesheet should have a scale of 2.

replaceWithScaledBitmap

(
  • idOrDict
  • [scale]
)
static

Replaces Bitmaps in the global lib dictionary with a version that uses a scaled bitmap, so you can load up smaller bitmaps behind the scenes that are scaled back up to normal size.

Parameters:

  • idOrDict String | Object

    A dictionary of Bitmap ids to replace, or a single id.

  • [scale] Number optional

    The scale to apply to the image(s).